/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: Direcotry.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/11 上午9:24
 * LastModified: 2020/03/11 09:24:11
 */

package com.qolome.knowledge.design.pattern.composite.demo.permission;

import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author Qolome
 * @version V1.0
 * @Description 目录
 * @date 2020年 03月11日 09:24:15
 */
@Slf4j
public abstract class PermissionPart extends Permission{

    private List<Permission> permissions;

    public PermissionPart(Long id, Long pid, String name, String xpath) {
        super(id, pid, name, xpath);
    }


    @Override
    public void show(){
        log.info("name:{}", name);
        //SQL查询拼装
        log.info("permissions",permissions);
    }

    public void list(){
        for (Permission permission : permissions) {
            log.info("file name:{}",permission.name);
        }
    }

    public boolean add(Permission permission){

        // 数据库新增
        return true;
    }

    public boolean remove(Long id){
        return true;
    }

    public Permission get(String path){
        //SQL拼装查询
        return null;
    }






}
